package base.httpclient.demo01;

import base.util.HttpClientUtil;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class PostRequest {
    public static void main(String[] args) {
        // 自行百度如何通过post请求发送表单，文件上传等
        HashMap<String, String> headers = new HashMap<>();
        List<NameValuePair> list = new ArrayList<>();
        list.add(new BasicNameValuePair("username", "zhou"));
        list.add(new BasicNameValuePair("password", "123456"));
        final String response = HttpClientUtil.doPostForm("", headers, list);
        System.out.println("响应：" + response);
    }
}
